package com.ruoyi.project.system.user.domain;

import org.springframework.ldap.odm.annotations.Attribute;
import org.springframework.ldap.odm.annotations.DnAttribute;
import org.springframework.ldap.odm.annotations.Entry;
import org.springframework.ldap.odm.annotations.Id;

import javax.naming.Name;

@Entry(objectClasses = {"inetOrgPerson"})
public class LdapUser {

    @Id
    private Name id;

    @DnAttribute(value = "uid",index = 1)
    @Attribute(name = "uid")
    private String uid;

    @Attribute(name = "cn")
    private String name;

    @Attribute(name = "email")
    private String email;

//    @Attribute(name = "gidNumber")
//    private Long gid;

    @Attribute(name = "userPassword")
    private String password;

//    @Attribute(name = "givenName")
//    private String firstName;

    @Attribute(name = "sn")
    private String lastName;

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
//
//    public Long getGid() {
//        return gid;
//    }
//
//    public void setGid(Long gid) {
//        this.gid = gid;
//    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
//
//    public String getFirstName() {
//        return firstName;
//    }
//
//    public void setFirstName(String firstName) {
//        this.firstName = firstName;
//    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public Name getId() {
        return id;
    }

    public void setId(Name id) {
        this.id = id;
    }

    public String toString() {
        return "LdapUser{" +
                "uid='" + uid + '\'' +
                ", fullName='" + name + '\'' +
                ", lastName='" + lastName + '\'' +
                '}';
    }
}
